package org.dousb.doupicture.shared.imagesearch.sub;

import org.dousb.doupicture.shared.imagesearch.model.ImageSearchResult;

import java.util.List;

/**
 * 图片搜索门面类
 */
public class ImageSearchApiFacade {
    /**
     * 根据图片url搜索图片列表
     *
     * @param imageUrl
     * @return
     */
    public static List<ImageSearchResult> searchResultList(String imageUrl) {
        String pageUrl = GetImagePageUrlApi.getImagePageUrl(imageUrl);
        String firstUrl = GetImageFirstUrlApi.getImageFirstUrl(pageUrl);
        List<ImageSearchResult> imageSearchResultList = GetImageListApi.getImageList(firstUrl);
        return imageSearchResultList;
    }

    public static void main(String[] args) {
        String imageUrl = "http://www.xiaohongshu.com/discovery/item/5f34cf790000000001009ecc";
        List<ImageSearchResult> imageSearchResultList = searchResultList(imageUrl);
        System.out.println(imageSearchResultList);
    }
}
